<template>
  <div class="welcome" v-show="showCover">
    <img src="http://47.75.99.213/app/cdn/cover.jpg" alt="">
  </div>
</template>

<script>
import { setCookie,getCookie } from '@/utils/auth'
export default {
  name: 'welcome',  
  data(){
    return{
      showCover:true
    }
  },
  mounted(){
    // 检查cookie
    if(getCookie('comming')){
      this.showCover = false;
    }else{
      this.showCover = true;
    }
    setTimeout(()=>{
      this.showCover = false;
      setCookie('comming',true);  // 显示并隐藏后进行缓存，表示已显示过，浏览器关闭则清除缓存
    },2000)

    // 杀掉进程后（关闭浏览器），此时cookie已经失效，下次进入显示封面 
  }
}
</script>

<style lang="stylus" scoped>
.welcome{
  height:100%;
  overflow: hidden;
  position: absolute;
  top:0;
  left:0;
  bottom:0;
  right:0;
  z-index: 9999;
  background: #fff;
}
</style>
